﻿using GBT.AmoebaManage.Controllers.Base_Manage;
using System;
using System.Collections.Generic;
using System.Text;
using GBT.Business.Base_Manage;
using GBT.Util;
using System.Security.Principal;
using Microsoft.Extensions.DependencyInjection;
using EFCore.Sharding;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using GBT.Entity.Base_Manage;
using DingTalk.Api;
using DingTalk.Api.Request;
using DingTalk.Api.Response;
using GBT.Entity;
using Newtonsoft.Json.Linq;
using GBT.Business.DDApi;
using System.Linq;
using LinqKit;
using System.Threading.Tasks;

namespace GBT.Control.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            //ServiceCollection services = new ServiceCollection();
            //services.AddEFCoreSharding(config =>
            //{
            //    config.UseDatabase("Data Source=47.111.162.139;Initial Catalog=GBT.AmoebaManage;Integrated Security=False;User ID=sa;Password=Aa123456..//;Pooling=true;", DatabaseType.SqlServer);

            //    //添加数据源
            //    config.AddDataSource("Data Source=47.111.162.139;Initial Catalog=GBT.AmoebaManage;Integrated Security=False;User ID=sa;Password=Aa123456..//;Pooling=true;", ReadWriteType.Read | ReadWriteType.Write, DatabaseType.SqlServer);

            //});
            //var serviceProvider = services.BuildServiceProvider();

            //var db = serviceProvider.GetService<IDbAccessor>();

            //Base_UserBusiness _UserBusiness = new Base_UserBusiness(db, null, null, null);
            //Base_User theData = new Base_User();
            //_UserBusiness.SyncDataAsync(theData);

            DDApi dDApi = new DDApi();
            var result = dDApi.SendMessage("2455662643844669", "测试111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111");
            Console.WriteLine(result.ToJson());
            Console.WriteLine("Hello World!");
            Console.ReadLine();
        }
    }
}
